package pl.edu.pk.mech.kkbus.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import pl.edu.pk.mech.kkbus.component.ExternalEmailSender;
import pl.edu.pk.mech.kkbus.model.ContactMessage;

@Service
public class ContactService {
    
    @Autowired
    ExternalEmailSender emailSender;
    
    public boolean sendMessage(ContactMessage contactMessage) {
        return emailSender.send(contactMessage.getTo(),
                contactMessage.getSubject(), contactMessage.getMessage());        
    }
}
